Skip to content

fix: harden ComfyUI reads, the agent settings seal, agent file writes, library saves and the Windows program starter - #39

Merged
nodemode-ai merged 15 commits into
mainfrom
fix/review-2026-11-28
Nov 29, 2026
Merged

nodemode-ai merged 15 commits into
mainfrom
fix/review-2026-11-28

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ComfyUI: the GET routes that contact a ComfyUI server with the saved sign-in (status, graph, upscale-models, job, image) now need the window key, as the POST routes already do.
  • Agent settings: Blocked is now sealed along with the other agent settings. A seal that no longer matches is reported as changed outside formvis, so edits to Blocked or to the agent folders show up. Settings sealed by an earlier version still load and are sealed again.
  • Agent file tools (convert_file, export_image, save_project, export_mask, export_layer, timeline_render) now write to a temporary file beside the target, flush it and rename it over the target. A failed write leaves the earlier file in place.
  • Moving the library to a folder that already has projects with the same names now picks the next free (moved N) name, so no existing project is replaced.
  • Save to Library and Save a Copy now ask before replacing a project whose name differs only in letter case or in spaces at either end.
  • Windows: an npm .cmd shim is started directly as its node script or .exe, without cmd.exe. Any other .cmd or .bat still goes through cmd.exe, but a word with a control character, a %, or a cmd special character outside quotes is refused with a message. The shared finder is now version 1.0.2 and its hash is recorded.
  • Test plan: new backend tests for each change (they fail on the previous code), a vitest for the library name check, the full backend and frontend suites, the window tests, and the repo checks (counts --check, agents sync --check).
  • On Windows, when a program still has to start through the command interpreter, any argument or program path containing & | < > ^ ( ) ! % " or a control character is refused, whether quoted or not. The error message suggests standard input or a file for long text.
  • An npm shim whose node turns out to be a batch file is no longer started directly.
  • The agent settings seal now carries a version, so a sealed file can only be checked against the current seal. Seal marks are validated as 64 hex characters and compared as bytes.
  • An agent settings file that cannot be read, parsed or checked is treated as a broken seal. Outside agents are then blocked, allowed is cleared and allow policies become ask.

Tests

  • Each fix has a test that fails on the previous code where practical.
  • The repo CI commands were run locally on macOS. Every failure seen locally also fails on main in the same environment (missing local tools or platform-specific tests); none is introduced here.
  • Please rely on this PR's CI run for Linux and Windows.

For the owner

  • A few related items need an owner decision; they are listed separately, not here.

How to ship

  • Independent of other repos; merge in any order. No version bump; release as usual.

…ey, as its writes do

status, graph, upscale-models, job and image send the saved ComfyUI sign-in to the address they are given, so only the formvis window may ask for them.
…t no longer matches is reported

Blocked joins the sealed fields. A file whose seal does not match its values reads as changed outside formvis even when nothing in it was loosened, so a change to Blocked or to the agent folders is reported. A choice sealed before Blocked was sealed stands and is sealed again on load.
…t and rename it over, as the window's saves do

export_image, save_project, export_mask, export_layer, timeline_render and convert_file no longer truncate the file they replace before the new one is complete, so a full disk or a stop part way leaves the earlier file.
…whose name is taken there

A project moved into a folder that already holds both its name and its (moved) name is now saved as (moved 2) and on, so no project there is replaced.
…hose name differs only in letter case

macOS and Windows file systems treat Poster and poster as one file, so Save to Library and Save a Copy now compare names without letter case before deciding whether to ask about replacing one.
…cmd.exe gets only words it passes unchanged

The finder is 1.0.2. A .cmd shim that npm wrote is started as the node script or program it names, so the words typed in the dock reach the program as typed. Any other .cmd or .bat still goes through cmd.exe, and a word with a control character, a %, an unmatched quote or one of & | < > ^ ( ) outside quotes is refused with a message. LOOKUP_HASHES records the new hash.
A launcher that sets its own variables, or hands its arguments to a program with a script in front of them, is no longer started as the first .exe it names; it goes through the command interpreter checks instead. LOOKUP_HASHES records the finder's new hash.
The engine trims a library name before saving, so a name typed with a space at either end now asks before replacing the project it matches.
…not be checked blocks outside agents

New seals write sealVersion and cover it, so a versioned file is only checked against the current seal and never read in the earlier format. A seal mark must be 64 hex characters before it is compared, as bytes. A file that cannot be read, parsed or checked is a broken seal, and a broken seal blocks outside agents, clears allowed and turns allow policies to ask.
…, quoted or not

When a program still starts through the Windows command interpreter, any word, its path included, with one of & | < > ^ ( ) ! % " or a control character is refused, with a message to pass long text through standard input or a file. The quote-based reading is gone. A shim whose node is itself a batch file is not started directly. LOOKUP_HASHES records the finder's new hash; the living log records both changes.
…led, and the earlier format keeps Blocked on

A stored choice with no seal mark stands only while the keychain holds no seal key and no versioned file has been sealed, and only when nothing is loosened; loosened now also counts outside agents not blocked and folder limits that are empty or that the loader would change. Sealing a versioned file is recorded in the keychain, and from then on the earlier format is refused. A file accepted in the earlier format, whose seal never covered blocked, keeps Blocked on and allowed false until it is sealed again.
…chain item

The record that a versioned file was sealed is kept beside the key in the agents-seal item (the key in hex followed by :v2), so the two cannot be changed apart; an item in the earlier layout gains the mark on the next seal. An item that cannot be read as a key counts as no key and recorded, so stored choices read as broken instead of the seal turning off, and a refused write of the record keeps it in memory with the key still in use.
…ystem

conftest.py points HOME, USERPROFILE, LOCALAPPDATA, APPDATA and the XDG folders at a temporary folder before any test module is imported, since localgen.paths reads the data folder at import. The ffmpeg fixture set only XDG_DATA_HOME, which macOS and Windows ignore, so it wrote a stub ffmpeg into the shared folder and left it on PATH; it now redirects every folder ff.folder() reads into tmp_path, restores PATH and checks the real folder is unchanged. The shared model folder for the segmentation tests moves beside pytest's temporary folders.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:20
Resolve the conflict in frontend/HASHOUT_LOG.md: keep the library-name
entry from this branch on top and both 2.8.4 menu entries from main
below it. The unreleased entries in both HASHOUT_LOGs now read
"after 2.8.4".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDaBjhAMUFzDLdeSMKe5tN
@nodemode-ai
nodemode-ai merged commit fedebea into main Nov 29, 2026
6 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants